package com.chinacoal.microservice;

import java.util.List;

import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import com.chinacoal.microservice.fallback.IndicatorClientFallback;
import com.chinacoal.microservice.pojo.CcmsSmartleasingIndicator;
import com.chinacoal.microservice.util.Result;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 * 考核模块-指标管理
 * @author wiilead
 *
 */
@FeignClient(name = "${spring.application.name}",fallback = IndicatorClientFallback.class,configuration = FeignAutoConfiguration.class)
@Api(tags = {"考核模块-指标管理"})
public interface IndicatorClient {
	
	@ApiOperation(value = "添加或修改指标")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "indicator", value = "指标实体类", required = true, dataType = "CcmsSmartleasingIndicator"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
	@PostMapping("smartleasing/indicator/addOrUpdateIndicator")
	public Result addOrUpdateIndicator(@RequestBody CcmsSmartleasingIndicator indicator,
									   @RequestHeader("token") String token);
	
	@ApiOperation(value = "查询所有指标列表")
	@GetMapping("smartleasing/indicator/getIndicatorList")
	public Result<List<CcmsSmartleasingIndicator>> getIndicatorList();
	
	@ApiOperation(value = "删除指标")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", name = "indicatorId", value = "指标Id", required = true, dataType = "String")
    })
	@GetMapping("smartleasing/indicator/deleteIndicator/{indicatorId}")
	public Result deleteIndicator(@PathVariable(value = "indicatorId") String indicatorId);
}
